<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/12/31
 * Time: 14:51
 */

namespace app\api\validate;


class SearchKey extends BaseValidate
{
    protected $rule = [
        'key' => 'require|checkSearchKey'
    ];
    protected $message = [
        'key' => 'key不能为空，多个key请用空格分格'
    ];

    protected function checkSearchKey($data){
        $dataArray = explode(' ', $data);

        if(empty($dataArray)){
            return false;
        }

        return true;
    }
}